package com.qutan.app.redisConfig;

import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * Created by pengweiyuan on 6/1/16.
 */
@Component
public class RedisConfig {

    @Bean
  public GenericObjectPoolConfig genericObjectPoolConfig(){
      GenericObjectPoolConfig config=new GenericObjectPoolConfig();
      config.setMaxIdle(100);
      config.setMaxTotal(1000);//最大连接数
      config.setMaxWaitMillis(-1);
      config.setMinIdle(8);
        return config;
  }
    @Bean
  public JedisClusterFactory jedisClusterFactory(){
      return  new JedisClusterFactory();
  }

}
